import request from '../../utils/Request'

export const saveRole = data => {
  return request({
    method: 'post',
    url: '/api/manage/role/save',
    data: data
  })
}
export const createRole = data => {
  return request({
    method: 'post',
    url: '/api/manage/role/create',
    data: data
  })
}
export const updateRole = data => {
  return request({
    method: 'post',
    url: '/api/manage/role/update',
    data: data
  })
}

export const updateRoleStatus = (roleId, status) => {
  return request({
    method: 'get',
    url: '/api/manage/role/' + roleId+ '/status/' + status,
    params: {}
  })
}

export const bindRoleUser = data => {
  return request({
    method: 'post',
    url: '/api/manage/role/bind/user',
    data: data
  })
}

export const deleteRole = bId => {
  return request({
    method: 'get',
    url: '/api/manage/role/delete/' + bId,
    params: {}
  })
}

export const selectRole = bId =>{
  return request({
    method: 'get',
    url: '/api/manage/role/select' + bId
  })
}

export const listRole = data =>{
  return request({
    method: 'get',
    url: '/api/manage/role/list',
    params: data
  })
}